package com.hm.day45e.controller;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

@ControllerAdvice
public class MyExceptionHandle {
	@ExceptionHandler
	public ModelAndView doAllException(Exception ex){
		ModelAndView mv = new ModelAndView("/login");
		mv.addObject("code", ex.getMessage());
		ex.printStackTrace();
		return mv;
	}
}
